//
//  ViewController.m
//  XWCountDownDemo
//
//  Created by huanlv on 2017/7/19.
//  Copyright © 2017年 Wade Xie. All rights reserved.
//

#import "ViewController.h"
#import "XWCountDown.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
}
- (void)setupUI {
    XWCountDownButton *btn = [[XWCountDownButton alloc] initWithFrame:CGRectMake(50, 200, 150, 50)];
    btn.totalTime = 15;
    btn.countDownType = XWCountDownThree;
    [btn setTitle:@"获取短信验证码" forState:UIControlStateNormal];
    btn.layer.borderColor = [UIColor orangeColor].CGColor;
    btn.layer.borderWidth = 5.0f;
    btn.backgroundColor = [UIColor grayColor];
    [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
}
- (void)btnClick:(XWCountDownButton *)btn {
    [btn startCountDown];
}

@end
